package club.hicode.daydayup.lambda;

/**
 * 学习Lambda
 *
 * @author Liu Chunfu
 * @date 2018-07-26 下午5:21
 **/
//@FunctionalInterface
//interface Print<T> {
//	public void print(T x);
//}
//
//public class Lambda {
//	public static void PrintString(String s, Print<String> print) {
//		print.print(s);
//	}
//
//	public static void main(String[] args) {
//		PrintString("test", (x) -> System.out.println(x));
//	}
//}


@FunctionalInterface
interface Print<T> {
    public void print(T x);
}

public class Lambda {
    public static void PrintString(String s, Print<String> print) {
        print.print(s);
    }

    private static void lambda$0(String x) {
        System.out.println(x);
    }

    final class $Lambda$1 implements Print {
        @Override
        public void print(Object x) {
            lambda$0((String) x);
        }
    }

    public static void main(String[] args) {
        Lambda lambda = new Lambda();
        $Lambda$1 $Lambda$1 = lambda.new $Lambda$1();

        PrintString("test", new Lambda().new $Lambda$1());
    }
}